﻿﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Xml.Serialization;
using Fcdbas.Core;
using Fcdbas.Core.Configuration;
using Fcdbas.Core.DataAccess;


namespace Fcdbas.Biz
{
    /// <summary></summary>
    [Serializable]
    [DataObject]
    [Description("")]
    [BindTable("fnd_pres_object_tab", Description = "", ConnName = "", DbType = DatabaseType.MySql)]
    public class fnd_pres_object : Entity<fnd_pres_object>,Ifnd_pres_object
    {
        #region 属性
 
        private String _pres_object;

        /// <summary>FLAGS=KMI-L^DATATYPE=STRING(50)^PROMPT=Pres Object^</summary>
        [DisplayName("Object")]
        [Description("FLAGS=KMI-L^DATATYPE=STRING(50)^PROMPT=Pres Object^")]
        [DataObjectField(true, false, false, 50)]
        [BindColumn(1, "pres_object",  null, "varchar(50)", 0, 0, false)]

        public virtual String pres_object

        {
            get { return _pres_object; }
            set { if (OnPropertyChanging(__.pres_object, value)) { _pres_object = value; OnPropertyChanged(__.pres_object); } }
        }

 
        private String _description;

        /// <summary>FLAGS=AMIUL^DATATYPE=STRING(200)^PROMPT=Description^</summary>
        [DisplayName("Description")]
        [Description("FLAGS=AMIUL^DATATYPE=STRING(200)^PROMPT=Description^")]
        [DataObjectField(false, false, false, 200)]
        [BindColumn(2, "description",  null, "varchar(200)", 0, 0, false)]

        public virtual String description

        {
            get { return _description; }
            set { if (OnPropertyChanging(__.description, value)) { _description = value; OnPropertyChanged(__.description); } }
        }

 
        private String _object_type;

        /// <summary>FLAGS=A-IUL^DATATYPE=STRING(50)^PROMPT=Object Type^</summary>
        [DisplayName("Type")]
        [Description("FLAGS=A-IUL^DATATYPE=STRING(50)^PROMPT=Object Type^")]
        [DataObjectField(false, false, true, 50)]
        [BindColumn(3, "object_type",  null, "varchar(50)", 0, 0, false)]

        public virtual String object_type

        {
            get { return _object_type; }
            set { if (OnPropertyChanging(__.object_type, value)) { _object_type = value; OnPropertyChanged(__.object_type); } }
        }

 
        private String _module;

        /// <summary>FLAGS=A-IUL^DATATYPE=STRING(35)/UPPERCASE^PROMPT=Module^</summary>
        [DisplayName("Module")]
        [Description("FLAGS=A-IUL^DATATYPE=STRING(35)/UPPERCASE^PROMPT=Module^")]
        [DataObjectField(false, false, true, 35)]
        [BindColumn(4, "module",  null, "varchar(35)", 0, 0, false)]

        public virtual String module

        {
            get { return _module; }
            set { if (OnPropertyChanging(__.module, value)) { _module = value; OnPropertyChanged(__.module); } }
        }

 
        private String _lu_name;

        /// <summary>FLAGS=A-IUL^DATATYPE=STRING(35)^PROMPT=Lu Name^</summary>
        [DisplayName("Name")]
        [Description("FLAGS=A-IUL^DATATYPE=STRING(35)^PROMPT=Lu Name^")]
        [DataObjectField(false, false, true, 35)]
        [BindColumn(5, "lu_name",  null, "varchar(35)", 0, 0, false)]

        public virtual String lu_name

        {
            get { return _lu_name; }
            set { if (OnPropertyChanging(__.lu_name, value)) { _lu_name = value; OnPropertyChanged(__.lu_name); } }
        }

 
        private String _objid;

        /// <summary></summary>
        [DisplayName("Objid")]
        [Description("")]
        [DataObjectField(false, false, false, 50)]
        [BindColumn(6, "rowid",  null, "varchar(50)", 0, 0, false)]

        public virtual String rowid

        {
            get { return _objid; }
            set { if (OnPropertyChanging(__.objid, value)) { _objid = value; OnPropertyChanged(__.objid); } }
        }


        private DateTime? _objversion;

        /// <summary></summary>
        [DisplayName("Objversion")]
        [Description("")]
        [DataObjectField(false, false, true, 24)]
        [BindColumn(7, "rowversion", null, "datetime", 0, 0, false)]

        public virtual DateTime? rowversion

        {
            get { return _objversion; }
            set { if (OnPropertyChanging(__.objversion, value)) { _objversion = value; OnPropertyChanged(__.objversion); } }
        }
        #endregion

        #region 获取/设置 字段值
        /// <summary>
        /// 获取/设置 字段值。
        /// 一个索引，基类使用反射实现。
        /// 派生实体类可重写该索引，以避免反射带来的性能损耗
        /// </summary>
        /// <param name="name">字段名</param>
        /// <returns></returns>
        public override Object this[String name]
        {
            get
            {
                switch (name)
                {
                    case __.pres_object : return _pres_object;
                    case __.description : return _description;
                    case __.object_type : return _object_type;
                    case __.module : return _module;
                    case __.lu_name : return _lu_name;
                    case __.objid : return _objid;
                    case __.objversion : return _objversion;
                    default: return base[name];
                }
            }
            set
            {
                switch (name)
                {
                    case __.pres_object : 
                        if(value != null)
                            _pres_object = Convert.ToString(value);
                        else
                            _pres_object = null;
                    break;
                    case __.description : 
                        if(value != null)
                            _description = Convert.ToString(value);
                        else
                            _description = null;
                    break;
                    case __.object_type : 
                        if(value != null)
                            _object_type = Convert.ToString(value);
                        else
                            _object_type = null;
                    break;
                    case __.module : 
                        if(value != null)
                            _module = Convert.ToString(value);
                        else
                            _module = null;
                    break;
                    case __.lu_name : 
                        if(value != null)
                            _lu_name = Convert.ToString(value);
                        else
                            _lu_name = null;
                    break;
                    case __.objid : 
                        if(value != null)
                            _objid = Convert.ToString(value);
                        else
                            _objid = null;
                    break;
                    case __.objversion : 
                        if(value != null)
                            _objversion = Convert.ToDateTime(value);
                        else
                            _objversion = null;
                    break;
                    default: base[name] = value; break;
                }
            }
        }
        #endregion

        #region 字段名
        /// <summary>取得字段信息的快捷方式</summary>
        public class _
        {
            ///<summary>FLAGS=KMI-L^DATATYPE=STRING(50)^PROMPT=Pres Object^</summary>
            public static readonly Field pres_object = FindByName(__.pres_object);

            ///<summary>FLAGS=AMIUL^DATATYPE=STRING(200)^PROMPT=Description^</summary>
            public static readonly Field description = FindByName(__.description);

            ///<summary>FLAGS=A-IUL^DATATYPE=STRING(50)^PROMPT=Object Type^</summary>
            public static readonly Field object_type = FindByName(__.object_type);

            ///<summary>FLAGS=A-IUL^DATATYPE=STRING(35)/UPPERCASE^PROMPT=Module^</summary>
            public static readonly Field module = FindByName(__.module);

            ///<summary>FLAGS=A-IUL^DATATYPE=STRING(35)^PROMPT=Lu Name^</summary>
            public static readonly Field lu_name = FindByName(__.lu_name);

            ///<summary></summary>
            public static readonly Field objid = FindByName(__.objid);

            ///<summary></summary>
            public static readonly Field objversion = FindByName(__.objversion);

            static Field FindByName(String name) { return Meta.Table.FindByName(name); }
        }

        /// <summary>取得字段名称的快捷方式</summary>
        class __
        {
            ///<summary>FLAGS=KMI-L^DATATYPE=STRING(50)^PROMPT=Pres Object^</summary>
            public const String pres_object = "pres_object";

            ///<summary>FLAGS=AMIUL^DATATYPE=STRING(200)^PROMPT=Description^</summary>
            public const String description = "description";

            ///<summary>FLAGS=A-IUL^DATATYPE=STRING(50)^PROMPT=Object Type^</summary>
            public const String object_type = "object_type";

            ///<summary>FLAGS=A-IUL^DATATYPE=STRING(35)/UPPERCASE^PROMPT=Module^</summary>
            public const String module = "module";

            ///<summary>FLAGS=A-IUL^DATATYPE=STRING(35)^PROMPT=Lu Name^</summary>
            public const String lu_name = "lu_name";

            ///<summary></summary>
            public const String objid = "rowid";

            ///<summary></summary>
            public const String objversion = "rowversion";

        }
        #endregion
    }

    /// <summary>接口</summary>
    public partial interface Ifnd_pres_object
    {
       #region 属性
        /// <summary>FLAGS=KMI-L^DATATYPE=STRING(50)^PROMPT=Pres Object^</summary>

        String pres_object { get; set; }


        /// <summary>FLAGS=AMIUL^DATATYPE=STRING(200)^PROMPT=Description^</summary>

        String description { get; set; }


        /// <summary>FLAGS=A-IUL^DATATYPE=STRING(50)^PROMPT=Object Type^</summary>

        String object_type { get; set; }


        /// <summary>FLAGS=A-IUL^DATATYPE=STRING(35)/UPPERCASE^PROMPT=Module^</summary>

        String module { get; set; }


        /// <summary>FLAGS=A-IUL^DATATYPE=STRING(35)^PROMPT=Lu Name^</summary>

        String lu_name { get; set; }


        /// <summary></summary>

        String rowid { get; set; }


        /// <summary></summary>

        DateTime? rowversion { get; set; }

        #endregion

        #region 获取/设置 字段值
        /// <summary>获取/设置 字段值。</summary>
        /// <param name="name">字段名</param>
        /// <returns></returns>
        Object this[String name] { get; set; }
        #endregion
    }
}